package com.mycompany.app.hr.tna.batch.writer;

import org.hibernate.SessionFactory;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemWriter;

import com.mycompany.app.hr.common.utility.dao.hibernate.SimpleHibernateTemplate;
import com.mycompany.app.hr.tna.model.PunchClock;

public class PunchClockWriter implements ItemWriter {

    SimpleHibernateTemplate<PunchClock, Long> punchClockDao;

    public PunchClockWriter(SessionFactory sf) {

        super();
        punchClockDao = new SimpleHibernateTemplate<PunchClock, Long>(sf,
                PunchClock.class);
    }

    public void clear() throws ClearFailedException {

        // TODO Auto-generated method stub

    }

    public void flush() throws FlushFailedException {

        // TODO Auto-generated method stub

    }

    public void write(Object item) throws Exception {

        punchClockDao.save((PunchClock) item);
    }

}
